;nasm -f macho64 64.s
;ld 64.o -o 64

SECTION .text
extern _sqrtl
global _main

%define mk64 0x2000000+

_main:
mov rax, mk64 4      ; syscall 4: write (
mov rdi, 1              ;    fd,
;mov rsi, Msg            ;    buffer,
lea rsi,[rel Msg]
mov rdx, Len            ;    size
syscall                 ; )

mov eax,mk64 197
mov rdi,0
mov rsi,100000000
mov rdx,3
mov r10,0x1001
mov r8,-1
mov r9,0
syscall
;mov [qword buf],rax
;mov rax,buf
;mov rax,[qword buf]

mov rax,0x12345678aabbccdd
push rax
sub rsp,8

call _sqrtl
add rsp,16

mov rax , mk64 1      ; syscall 1: exit (
mov rdi, 0              ;    retcode
syscall                 ; )

SECTION .data
Msg db `Hello, world!\n`
Len: equ $-Msg
buf: dq 0
